import React from 'react'
// import {useSearchParams,} from 'react-router-dom'
// import {useParams,useMatch} from 'react-router-dom'
import {useLocation } from 'react-router-dom'

export default function One() {
  // 对应关系
  // params  useParams
  // search useSearchParams
  // state useState
 
  // 1、useSearchParams
  // const [search,setSearch] =useSearchParams()
  // const id=search.get('id')
  // const title=search.get('title')
  // const content=search.get('content')
  // 2.useMatch
  // const x=useMatch('home/message/one/:id/:title/:content')
  // console.log(x);
  // 3.useLocation
  const {state:{id,title,content}}= useLocation()
  return (
    <div>
      三级菜单栏--One
      {/* <button onClick={()=>{setSearch('id=008&title=哈哈&content=null')}}>点击调用setSearch更新数据</button> */}
      <ul>
        <li>消息編號：{id}</li>
        <li>消息标题：{title}</li>
        <li>消息内容：{content}</li>
      </ul>
    </div>
  )
}
